import request from '../../request'
import { ISongListParams, ITopSongListData } from './type'


export const getChapterList = async () => {
    try {
        const res = await request({
            url: '/getChapterList',
            method: 'get'
        })
        return {
            chapterList: res.data.chapterList,
            characterList: res.data.characterList
        }
    } catch (err) {
        return {
            chapterList: [],
            characterList: []
        }
    }
}
export const getSongList = async (params: ISongListParams): Promise<ITopSongListData> => {
    try {
        const res = await request({
            url: '/getTopSongList',
            method: 'post',
            data: {
                ...params
            }
        })
        return {
            ...res.data
        }
    } catch (err) {
        return {
            songList: []
        }
    }
}